<template>
  <ul class="todo-list">
  
    <li v-for="item in list" :key="item.id" :class="{completed: item.isDone}">
      <div class="view">
        <input class="toggle" type="checkbox" v-model="item.isDone"/>
        <label>{{ item.name }}</label>
       
        <button class="destroy" ></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  
  // 子要
  props: {
    list: {
      // 必须要传
      required: true,
      // 限制类型为Array
      type: Array
    }
  }
}
</script>